Conversation
# Conflicts: # package.json # src/__tests__/__snapshots__/render-debug.test.tsx.snap # yarn.lock
# Conflicts: # package.json # src/fire-event.ts # src/helpers/component-tree.ts # src/matchers/__tests__/to-be-checked.test.tsx # src/matchers/__tests__/to-be-partially-checked.test.tsx # src/render.tsx # src/user-event/utils/dispatch-event.ts # yarn.lock
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1669 +/- ##
==========================================
- Coverage 95.51% 93.48% -2.04%
==========================================
Files 99 94 -5
Lines 5400 5435 +35
Branches 857 886 +29
==========================================
- Hits 5158 5081 -77
- Misses 242 354 +112 ☔ View full report in Codecov by Sentry. |
|
The fact that composite components aren't there anymore makes I wonder if we should consider removing it completely? Or maybe making it deprecated at first to ease migration but still aim at removing it in the long term. I don't think
Overall it would be a very difficult migration but that would make user's tests better in the end I think so I do think it's a reasonable option. Wdyt @mdjastrzebski @MattAgn ? |
|
I think we need to keep I deeply care about great many RN developers that wrote and/or now maintain large test bases full of Regarding User Event requiring fake timers, I think that many people are actually using them without fake timers, accepting the delay on |
|
Closing as replaced by #1705. |
Summary
Experimental test renderer replacing React Test Renderer, which is being deprecated.
Overview
The new renderer (React Native Test Renderer?) is a simple renderer created using
react-reconcilerpackage. It operates only on host elements and does not expose composite elements at all. It's still very simple and event propagation is still handled by RNTL.Details
Pressable/TouchablewhereonPressexists only on composite level, while on host element level it'sonResponderGrant+onResponderReleasepair. In order to minimise the impact on the existing testsfireEvent.pressactually callsonResponderGrant+onResponderReleaseto triggeronPressin such case.UNSAFE_xxxqueries (*byTypeand*byProps) and props (UNSAFE_container) no longer return composite elements, and can be either removed (high time) or kept but withoutUNSAFE_prefix as they are now safe.Textcomponent is now automatically detected on renderer error and triggers a throw, as it would in React Native renderer.Test status
All tests passing. Some tests had been disabled due to no longer being relevant.